<?php /*
	
*/ ?>
<?php include("inc/head.inc.php") ?>
<body>
<table width="824" border="0" cellpadding="0" cellspacing="0"  align="center">
  
  <tr>
    <td class="headerclass"><?php include("inc/top.inc.php") ?></td>
  </tr>
  <tr>
    <td valign="top" class="maincontainer"><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr><td valign="top"class="leftmenuback"><?php include("inc/left.inc.php") ?></td>
        <td valign="top">
		<div class="pageheader">Frequently Asked Questions</div>
<br /><br />
<div class="pageheader">Categories</div>	
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1">
	<?php 
	$sql="SELECT distinct(vartitle) FROM `tblfaq`";
	$res=$n02586916_db->select($sql);
	if($res) {
		for($a=0;$a<count($res);$a++) {
			?>
				<tr><td height="23"><img src="images/ques.gif" /> <a href="faq.php?cat=<?php echo stripslashes($res[$a]['vartitle']);?>" class="faq"><?php echo stripslashes($res[$a]['vartitle']);?></a></td></tr>
	<?php }
	}
?>
</table>

<?php
if (strlen($_GET['cat'])>0) {
echo "<br /><br /><div class=\"pageheader\">Question</div>";
echo "<table width=\"99%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">";
// show list of FAQ's here
	$qsql="SELECT intid, varquestion FROM `tblfaq` WHERE vartitle='".mysql_real_escape_string($_GET['cat'])."'";
	$qres=$n02586916_db->select($qsql);
	if($qres) {
		for($b=0;$b<count($qres);$b++) {
			?>
			<tr><td height="23"><img src="images/ques.gif" /> <a href="faq.php?cat=<?php echo stripslashes($_GET['cat']);?>&qid=<?php echo $qres[$b]['intid'];?>" class="faq">
			<?php echo stripslashes($qres[$b]['varquestion']);?>
			</a></td></tr>
			<?php
		}
	}
echo "</table>";
}
?>

<?php
if (strlen($_GET['qid'])>0) {
echo "<br /><br /><div class=\"pageheader\">Answer</div>";
echo "<table width=\"99%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"1\">";
// Show answer to selected question
	$asql="SELECT varanswer FROM `tblfaq` WHERE intid='".mysql_real_escape_string($_GET['qid'])."'";
	$ares=$n02586916_db->select($asql);
	if($ares) {
			?>
			<tr><td height="23"><?php echo stripslashes($ares[0]['varanswer']);?></td></tr>
			<?php
	}
echo "</table>";
}
?></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td><?php include "inc/bottom.inc.php"; ?></td>
  </tr>
</table>
</body>
</html>
